<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="m" uri="/cutm_tags"%>

<head>
<title>编辑方案审核</title>
<script type="text/javascript">
$(document).ready(function(){
	$("input[name='solution.id']").val("<s:property value='showSolutionModel.solution.id' />");
	$("input[name='review.level']").val("<s:property value='level' />");
	$("#editForm").vaildAjax(function(data){
		if(data==null || data==''){
			BaseJs.alert('审核成功');
			$('#save').hide();
			$('#edit').hide();
		}else{
			BaseJs.alert($.trim(data).substring(4));
		}
	});
});

	function editContent() {
		var solutionId = $('input[name=solution.id]').val();
		if(solutionId!=''){
			var url=BaseJs.action('solution/EditSolution!toEditContent')+'?solution.id='+solutionId;
			window.open(url);
		}else{
			BaseJs.alert('请先保存编辑方案');
		}
	}
</script>
</head>
<body>
<h3>编辑方案内容</h3>
<table id="sTable" class="form">
	<tbody>
		<tr>
			<th width="10%">方案名称</th>
			<td width="25%"><s:property value="showSolutionModel.solution.name" /></td>
			<th width="10%">期号</th>
			<td width="25%"><s:property value="showSolutionModel.solution.issue" /></td>
			<th width="10%">审核状态</th>
			<td width="20%"><s:if test="showSolutionModel.solution.status==0">未审核</s:if> <s:elseif
				test="showSolutionModel.solution.status==1">一审完毕</s:elseif> <s:elseif test="showSolutionModel.solution.status==2">二审完毕</s:elseif>
			<s:elseif test="showSolutionModel.solution.status==3">三审完毕</s:elseif>
			<s:elseif test="showSolutionModel.solution.status==4">审核完毕</s:elseif>
			<s:elseif test="showSolutionModel.solution.status==-1">审核不通过</s:elseif><s:else>未知错误</s:else></td>
		</tr>
		<tr>
			<th>出版日期</th>
			<td><s:date name="showSolutionModel.solution.date" format="yyyy-MM-dd" /></td>
			<th>创建时间</th>
			<td><s:date name="showSolutionModel.solution.recorderDate" format="yyyy-MM-dd" /></td>
			<th>创建人</th>
			<td><s:property value="showSolutionModel.solution.recorder.name" /></td>
		</tr>
	</tbody>
</table>
<s:if test="showSolutionModel.reviewList.size()>0">
	<h2 class="title">审核信息列表</h2>
	<table class="list">
		<thead>
			<tr>
				<th width="10%">审核级别</th>
				<th width="10%">审核人</th>
				<th width="10%">审核时间</th>
				<th width="10%">审核结果</th>
				<th width="60%">审核意见</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="showSolutionModel.reviewList" status="aa">
				<tr id="pt${id }">
					<td><s:property value="level" />审</td>
					<td><s:property value="auditUser.name" /></td>
					<td><s:date name="auditDate" format="yyyy-MM-dd HH:mm" /></td>
					<td>
					<s:if test="result==1">通过</s:if>
					<s:if test="result==2">不通过</s:if>
					<s:if test="result==3">审核完毕</s:if></td>
					<td><s:property value="auditRemark" /></td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
</s:if>
<s:if test="level>0">
<s:form id="editForm" action="solution/EditSolution!review" onsubmit="return true">
	<h3>编辑方案审核</h3>
	<s:hidden name="solution.id" />
	<s:hidden name="review.level"/>
	<table id="sTable" class="form">
		<tbody>
			<tr>
				<th width="20%">审核结果</th>
				<td width="80%"><s:radio name="review.result" list="#{1:'通过',2:'不通过',3:'审核完毕'}"  cssClass="rule[required]" listKey="key" listValue="value" /></td>
			</tr>
			<tr>
				<th>审核意见</th>
				<td><s:textarea name="review.auditRemark" id="aa" cssClass="rule[required]" ></s:textarea> </td>
			</tr>
		</tbody>
	</table>
	<div class="btnGroup"><input id="edit" value="方案内容修改" type="button"
			onclick="editContent();"><s:submit id="save" value="保存" /> </div>
</s:form>
</s:if>
<h2 class="title">编辑方案内容列表</h2>
<table class="list">
	<thead>
		<tr>
			<th width="5%">序号</th>
			<th width="10%">页码</th>
			<th width="10%">栏目</th>
			<th width="65%">稿件</th>
			<th width="10%">编辑</th>
		</tr>
	</thead>
	<tbody>
		<s:iterator value="showSolutionModel.contentList" status="aa">
			<tr id="pt${id }">
				<td><s:property value="#aa.index+1" /></td>
				<td><s:property value="page" /></td>
				<td><s:property value="solutionItem.colum" /></td>
				<td><s:property value="manuscript.title" /></td>
				<td><s:property value="solutionItem.editor.name" /></td>
			</tr>
		</s:iterator>
	</tbody>
</table>
</body>